On transforming expressions
On transforming expressions
Overview
Overview
◼ The most straightforward type of transformation is expansion. Expansion involves the transformation of products of sums into sums of products. GrassmannAlgebra has a function which expands all Grassmann products and complements in an expression , or specialized functions which expand only a specific type of product, for example, . The functions and expand a Grassmann expression whilst maintaining sums of terms of like grade together.
◼ Simplification is less straightforward because many rules may be involved, and "the most simple form" is somewhat dependent on the user's objectives. GrassmannAlgebra's most general simplification function, , will attempt to simplify an expression as far as possible without expanding it. Specialized functions, for example , will attempt to simplify only a specific type of product in an expression.
◼ Many expressions simplify most when both expansion and simplification are performed in sequence. In GrassmannAlgebra this may be effected for all products by , or for individual products by, for example, . The function is the equivalent of .
◼ The principle transformation functions above allow you to apply a sequence or list of extra functions or rules to an expression during the transformation process. The functions can be inbuilt Mathematica functions, from GrassmannAlgebra, or you can define them yourself. Rules can be from the GrassmannAlgebra rule database, or your own definitions.
◼ You can also perform the transformation and apply extra functions and rules while at the same time including assertions as to the grades of the elements in the expression.
◼ The converse transformation to expansion in GrassmannAlgebra is contraction. If an element of an expression is in a form such as might have resulted from application of or , it may be contracted again by using .
◼ Contraction may also be achieved by factorization. In this version of GrassmannAlgebra only factorization of sums of exterior products of the same grade is implemented in . Exterior factorization is not in general unique.
◼ Collecting together the scalar coefficients of like terms is effected by . Factoring the point out of an expression in basis form can be done using .
★
◼ Expressions involving regressive products may be transformed to expressions involving exterior products instead by using or one of its variants.
◼ Expressions can also be transformed by converting products from one form to another. For example, will take Clifford and hypercomplex products, and convert them to generalized products. will then take any of these three types and convert them to interior products. will convert any of Clifford, hypercomplex, generalized, interior, or inner products to scalar products.
◼ Expressions involving any of the exterior, regressive or interior products may be converted to expressions involving any other of the products. Such conversions will generally also involve the complement operation.
◼ Complements of basis elements of the exterior product space of grade m can be converted to basis elements of the complementary space of grade n-m.
◼ General transformations of expressions in GrassmannAlgebra often involves a sequence of operations. You can apply those operations in sequence as normal functions, or you can use or .
◼ There are many rules that can be used for transforming expressions from one form to another. A library of rules may be accessed through the function. Other functions may be used to search or tabulate these rules.
Examples
Examples
◼ Here is a bivector in 3-space, expressed in basis form :
★A;X=(a+b+c)⋀(d+e+f)
e
1
e
2
e
3
e
1
e
2
e
3
(a+b+c)⋀(d+e+f)
e
1
e
2
e
3
e
1
e
2
e
3
This is already the simplest form if you want a simple product, so applying doesn't change anything.
GrassmannSimplify[X]
(a+b+c)⋀(d+e+f)
e
1
e
2
e
3
e
1
e
2
e
3
However if you expand X with , you can express the product as a sum of component bivectors.
X1=GrassmannExpand[X]
(a)⋀(d)+(a)⋀(e)+(a)⋀(f)+(b)⋀(d)+(b)⋀(e)+(b)⋀(f)+(c)⋀(d)+(c)⋀(e)+(c)⋀(f)
e
1
e
1
e
1
e
2
e
1
e
3
e
2
e
1
e
2
e
2
e
2
e
3
e
3
e
1
e
3
e
2
e
3
e
3
Applying to this will now factor out the scalars, put to zero any exterior products of repeated basis elements and collect scalar multiples of the same basis elements.
GrassmannSimplify[X1]
(-bd+ae)⋀+(-cd+af)⋀+(-ce+bf)⋀
e
1
e
2
e
1
e
3
e
2
e
3
Because expansion and then simplification is a common operation, there is a single function for doing this: .
GrassmannExpandAndSimplify[X]
(-bd+ae)⋀+(-cd+af)⋀+(-ce+bf)⋀
e
1
e
2
e
1
e
3
e
2
e
3
Condense |
(a+b+c)⋀(d+e+f)
e
1
e
2
e
3
e
1
e
2
e
3
◼ Sometimes you may have a large expression involving different grades, and you want to expand it out whilst keeping the terms of like grade together, perhaps so that you can simplify them later. can do this. Again, suppose you have an expression
X=(1+a+b+c)⋀(1+d+e+f)
e
1
e
2
e
3
e
1
e
2
e
3
(1+a+b+c)⋀(1+d+e+f)
e
1
e
2
e
3
e
1
e
2
e
3
This form has nothing to simplify, so as before, applying doesn't change anything.
GrassmannSimplify[X]
(1+a+b+c)⋀(1+d+e+f)
e
1
e
2
e
3
e
1
e
2
e
3
Expanding X with , keeps the vectors that are expressed in terms of basis elements together.
X1=
[X]
GradedExpand |
1⋀1+1⋀(d+e+f)+(a+b+c)⋀1+(a+b+c)⋀(d+e+f)
e
1
e
2
e
3
e
1
e
2
e
3
e
1
e
2
e
3
e
1
e
2
e
3
GrassmannSimplify[X1]
1+(a+d)+(b+e)+(c+f)+(a+b+c)⋀(d+e+f)
e
1
e
2
e
3
e
1
e
2
e
3
e
1
e
2
e
3
This can be seen to be different to the results which would be given by first applying (which will expand the bivector into a sum of its component basis bivectors) and then applying :
GrassmannSimplify[GrassmannExpand[X1]]
1+(a+d)+(b+e)+(c+f)+(-bd+ae)⋀+(-cd+af)⋀+(-ce+bf)⋀
e
1
e
2
e
3
e
1
e
2
e
1
e
3
e
2
e
3
GrassmannExpandAndSimplify[X1]
1+(a+d)+(b+e)+(c+f)+(-bd+ae)⋀+(-cd+af)⋀+(-ce+bf)⋀
e
1
e
2
e
3
e
1
e
2
e
1
e
3
e
2
e
3
◼ Here is an example of using a rule and a grade assertion with GrassmannSimplify (we use the alias ★). First we define a rule:
rr=a_?
*x_{a,x};
ScalarQ |
★ |
by
★ |
{b,y}
However, if we assert that b is of grade other than zero, neither nor the rule will transform the expression (as would be expected).
★ |
★Λ
2
y⋀b
Expanding expressions
Expanding expressions
◼ Expansion involves the transformation of products of sums into sums of products. You can use (or its alias ) to expand all Grassmann products and complements in an expression, or use any of a suite of specialized functions each intended for expanding only a specific type of product or complement, for example, .
★ℰ
◼ expands exterior, regressive, interior, generalized, hypercomplex and Clifford products of sums of terms. It also converts complements of sums into sums of complements.
◼ and are similar to , except that they treat sums of terms of the same grade as a single term. and both take grade assertions as second arguments.
◼ , and can each take a second argument of transformation functions to be applied in addition to the expansion. These functions may be any Mathematica or GrassmannAlgebra functions, any functions you define yourself, or any combination of these.
◼ , , , , and , each expand just their own type of product.
◼ and distributes the complement operation over any sums.
◼ distributes scalar factors over non-scalar sums. (It does not expand products of scalars - this would be done with Mathematica's inbuilt .)
◼ Note that the expand functions do not make any simplifications.
Examples
Examples
◼ Here is the sum in a 2-space of a bivector (with grade 2) and the interior product of a bivector with a vector (which reduces to a vector (of grade 1)).
In[57]:=
★A;
;X=
⋀
⊖
+
⋀
★ℬ |
2
★ |
a
★ |
b
★ |
c
★ |
a
★ |
b
Out[57]=
(+)⋀(+)⊖(+)+(+)⋀(+)
a
1
e
1
a
2
e
2
b
1
e
1
b
2
e
2
c
1
e
1
c
2
e
2
a
1
e
1
a
2
e
2
b
1
e
1
b
2
e
2
expands every term.
In[61]:=
GrassmannExpand[X]
Out[61]=
()⋀()⊖+()⋀()⊖+()⋀()⊖+()⋀()⊖+()⋀()⊖+()⋀()⊖+()⋀()⊖+()⋀()⊖+()⋀()+()⋀()+()⋀()+()⋀()
a
1
e
1
b
1
e
1
c
1
e
1
a
1
e
1
b
1
e
1
c
2
e
2
a
1
e
1
b
2
e
2
c
1
e
1
a
1
e
1
b
2
e
2
c
2
e
2
a
2
e
2
b
1
e
1
c
1
e
1
a
2
e
2
b
1
e
1
c
2
e
2
a
2
e
2
b
2
e
2
c
1
e
1
a
2
e
2
b
2
e
2
c
2
e
2
a
1
e
1
b
1
e
1
a
1
e
1
b
2
e
2
a
2
e
2
b
1
e
1
a
2
e
2
b
2
e
2
leaves the exterior products unexpanded.
In[62]:=
ExpandInteriorProducts |
Out[62]=
(+)⋀(+)⊖+(+)⋀(+)⊖+(+)⋀(+)
a
1
e
1
a
2
e
2
b
1
e
1
b
2
e
2
c
1
e
1
a
1
e
1
a
2
e
2
b
1
e
1
b
2
e
2
c
2
e
2
a
1
e
1
a
2
e
2
b
1
e
1
b
2
e
2
◼ Here is the exterior square of a Grassmann number in a 2-space.
In[66]:=
G=a+b+x+y+⋀a+b+x+y+;
e
2
e
2
keeps the terms of the same grade unexpanded.
In[69]:=
GradedExpand |
Out[69]=
(a+b)⋀(a+b)+(a+b)⋀(x+y)+(a+b)⋀+(x+y)⋀(a+b)+(x+y)⋀(x+y)+(x+y)⋀+⋀(a+b)+⋀(x+y)+⋀
e
2
e
2
e
2
e
2
e
2
e
2
Simplifying expressions
Simplifying expressions
◼ Simplification is an operation in which there may be many rules involved, and "the most simple form" is somewhat dependent on the user's objectives.
◼ The degree of simplification achieved will depend on the dimension of the currently declared space.
Examples
Examples
◼ Here, as in the previous section, we take the sum in a 2-space of a bivector (with grade 2) and the interior product of a bivector with a vector (which reduces to a vector (of grade 1)).
GrassmannExpandAndSimplify expands all the products.
◼ Here is a Grassmann number of grade {0, 1, 2} in 4-space
Simplifying products
Simplifying products
◼ Sometimes it may be important to undertake the simplification of only particular types of subexpressions in an expression. The functions below have been designed to enable simplification, or expansion and simplification, only of particular types of product.
◼ All the ExpandAndSimplify-type functions are equivalent to applying the relevant Expand-type function followed by the relevant Simplify-type function, except ExpandAndSimplifyExteriorProducts which employs a special algorithm which may make it faster on larger expressions.
◼ These functions may be used individually, or may be combined together in Transform or TransformRepeated to construct specialized simplification functions.
◼ The degree of simplification achieved will depend on the dimension of the currently declared space.
Examples
Examples
◼ Here is a sum of products in a 3-space. Each term can be simplified, the first to the product of the scalars, and the second and third to zero.
Simplifying complements
Simplifying complements
◼ Simplifying or expanding and simplifying complements follows the same pattern, and has similar capabilities, to simplifying or expanding and simplifying products - the major difference being that the complement is a unary operation, whereas the products are binary.
Examples
Examples
◼ Here is the Grassmann complement of the expression used in the example of the previous section.
Contracting expressions
Contracting expressions
◼ Contracting operations attempt the equivalent of reversing any expansions that could notionally have been applied.
Examples
Examples
◼ Here is a simple 2-element in factored form
Expanding this expression gives
This can be condensed back to the original product since no simplifications have been made.
Expanding and simplifying gives
Condensing this expression does not recover the original one, since terms have been lost in the simplification.
Common factor expressions
Common factor expressions
◼ The resulting reduction will depend on the dimension of the currently declared space.
◼ The form (but not the result) of the reduction will depend on the order in which the factors of the product are treated by the algorithm.
◼ Note that although ★c is arbitrary, its value in a new basis will be augmented by a factor equal to the inverse of the determinant of the transformation to the new basis. The arbitrariness of the congruence factor arises from the fact that no metric is assumed in the common factor calculations, and hence the measure of the unit n-element is not defined.
Examples - these need updating for AngleBracket
Examples - these need updating for AngleBracket
◼ Here is the regressive product of two bivectors.
We can tabulate the common factor of these bivectors for different dimensions. Note the presence of the CongruenceFactor ★c. The result is a bivector in 2 dimensions, a vector in 3 dimensions, and a scalar in 4 dimensions.
◼ Here is the regressive product of three bivectors.
We can tabulate the common factor of these bivectors for different dimensions. The result is a bivector in 3 dimensions and a scalar in 4 dimensions.
◼ Here is the regressive product of two trivectors.
We can tabulate the common factor of these trivectors for different dimensions. The result is a trivector in 3 dimensions, a bivector in 4 dimensions, a vector in 5 dimensions, and a scalar in 6 dimensions.
Converting high level products
Converting high level products
◼ GrassmannAlgebra has a number of different products with which you can work: exterior, regressive, interior, inner, scalar, generalized, hypercomplex and Clifford.
◼ In the usual way of developing the algebra, the most basic product is the exterior product. The regressive product is then developed as a "dual" product to the exterior product (that is, it has the same axiom structure). The introduction of a complement operation (mapping) then enables the definition of the interior product (and its special cases the inner product and the scalar product). For ease of discussion, we call these low-level Grassmann products. From these can be defined generalized Grassmann, hypercomplex and Clifford products. We call the latter high-level Grassmann products.
◼ The Clifford and hypercomplex products are defined in terms of the generalized Grassmann product. The generalized product is defined in terms of the exterior and interior products. The interior product can be expanded in terms of the exterior product and the inner product. The inner product can be expanded in terms of scalar products. Scalar products of basis elements may be replaced by metric elements. Interior, inner or scalar products can be expressed in terms of the complement operation and either of the exterior product or the regressive product.
◼ Each of these functions will take any Grassmann expression as an argument and convert any "higher level" products to the level specified by the function name.
◼ See also the section below: Converting low level products.
Examples
Examples
◼ Consider a Clifford product of two bivectors (u⋀v)⋄(x⋀y) in a 4-space. In what follows, we will convert it stage by stage until the resulting expression involves only exterior and scalar products.
Naturally, we can expand and simplify any of these results if we wish.
If however, we change the metric to a general one, we will get a more complex result.
Converting low level products
Converting low level products
◼ GrassmannAlgebra has a number of different products with which you can work: exterior, regressive, interior, inner, scalar, generalized, hypercomplex and Clifford.
◼ In the usual way of developing the algebra, the most basic product is the exterior product. The regressive product is then developed as a "dual" product to the exterior product (that is, it has the same axiom structure, but different interpretation on its symbols). The introduction of a complement operation (mapping) then enables the definition of the interior product (and its special cases the inner product and the scalar product). For ease of discussion, we call these low-level Grassmann products.
◼ The exterior and regressive products are taken as basic. If a complement operation (or equivalently, a metric) is introduced (defined) on the space, then the exterior and regressive products can be expressed in terms of each other and the complement. The interior product operation can also be expressed in terms either of the exterior product and the complement, or else the regressive product and the complement. To complete the suite of conversion possibilities, the exterior and regressive products can be expressed in terms of the interior product and the complement, and the complement of an element can be expressed as its interior product with the unit n-element.
◼ Each of these functions will take any Grassmann expression as an argument and convert any lower level products to other lower level products as specified by the function name.
◼ Elements of an expression written as multigraded symbols will be automatically expanded to sums of graded symbols wherever necessary. This is because the sign of a resulting term is dependent on the grades of its factors.
◼ None of the functions in this suite will convert any generalized Grassmann, hypercomplex, or Clifford products, or apply specific complement operations. For these conversions see the sections Converting high level products and Converting complements.
Examples
Examples
◼ Here are some simple examples showing the effects of the conversions on a single expression in a 3-space.
Converting complements
Converting complements
Examples
Examples
◼ Here is a palette of the Grassmann complements of the basis elements of the Grassmann algebra of a Euclidean 3-space.
We could have effected this transformation as follows:
◼ Suppose now that we are working in a point 2-space (the plane). The Grassmann complements of the basis elements are given in the complement palette
We can, as before, obtain the Grassmann complements of the basis elements by entering
If we extract the basis elements that have been successfully converted, we see that they are simply the basis elements of a vector 2-space.
General transformation of expressions
General transformation of expressions
Examples
Examples
◼ Here we define a simple function that transforms scalar multiples.
Or indeed, by just rearranging the order of the transformation functions.
◼ As a second example we repeat the transformations above using the rule form of mp, rather than the function form. Here is mp defined as a rule:
Here is the same Grassmann expression as in the first example.
Transformation rules
Transformation rules
◼ GrassmannAlgebra has a database of transformation rules which you can access and apply to Grassmann expressions. The rules are in the form of Mathematica rules, so that you can apply them one at a time, sequentially, or together in a list.
Examples
Examples
Now if we apply these rules to an exterior product the first rule will fire and we will get the regressive product we are looking for.
◼ Suppose now that one of the factors in the exterior product is multigraded. If it is underscripted we must first convert it to unigraded symbols and then expand. If it is already a sum of terms, we must still expand the product of which it is a factor because the type of conversion we are seeking will give different results depending on the grades of the factors.
The conversion is then
◼ For future reference we may wish to determine the rule numbers of the rules in the list R.
However, searching using a pattern of the required form find the relevant rule.